package com.erp.database.utils;

import java.text.SimpleDateFormat;
import java.util.Calendar;

/** 
 * @author Buddy 
 * @version 0.0.1 
 * @CreateTime 2017年7月17日 上午11:03:48 
 * 类说明 
 */
public class DateMonthUtil {
	private static SimpleDateFormat format = new SimpleDateFormat("yyyy-MM");
	
	public static String getThisMonth(){
		Calendar c = Calendar.getInstance();
		String thisMonth = format.format(c.getTime());
		return thisMonth;
	}
	
	public static String getPreMonth(){
		Calendar c = Calendar.getInstance();
		c.add(Calendar.MONTH, -1);
		String preMonth = format.format(c.getTime());
		return preMonth;
	}
	
	public static String getNextMonth(){
		Calendar c = Calendar.getInstance();
		c.add(Calendar.MONTH, 1);
		String nextMonth = format.format(c.getTime());
		return nextMonth;
	}
}
